<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎使用HDPHP框架</title>
    <style type="text/css">
        body{
            background: #efefef;
        }
        div#main {
            padding: 30px 50px;
            font-family: "Microsoft Yahei", Helvetica, arial, sans-serif;
            margin-top: 90px;
        }

        div#main h1 {
            font-size: 50px;
            margin: 0px;
            color:#bbb;
            text-align: center;
        }
        div.hdphp{
            width: 200px;
            margin: 0 auto;
        }

    </style>
    {{bootstrap}}
    {{jquery}}
</head>
<body>
    <div id="main">
        <h1>环境检测</h1>
        <div class="hdphp" style="width:500px;height: 300px;border:3px solid red;margin:40px auto;line-height: 200px;">
            <h3>检测库</h3>
            <table class="table">
                <?php foreach ($env['fun'] as $key => $value) { ?>
                <tr>
                    <td>
                        {{$key}}
                    </td>
                    <td class="{{$value?'':error}}">
                        {{$value?'OK':'X'}}
                    </td>
                </tr>
                <?php } ?>   
            </table>
            <h3>检测文件</h3>
            <table class="table">
                {{foreach from="$env['dir']" key="$k" value="$v"}}
                <tr>
                    <td>
                        {{$k}}
                    </td>
                    <td>
                        {{$v}}
                    </td>
                </tr>
                {{endforeach}}
            </table>
            
        </div>
        <div class="hdphp">
            <a href="{{U('setup')}}" class="btn btn-default">上一页</a>
            <button class="btn btn-default" onclick="next()">下一页</button>
        </div>
    </div>
    <script>
    function next()
    {
        if($('.error').length>0)
        {
            alert('安装环境不满足');
            return false;
        }
        location.href = "{{U('database')}}";
    }
    </script>
</body>
</html>